Skip to content

Conversation

@mhlidd
Copy link
Contributor

@mhlidd mhlidd commented Jan 15, 2026

What Does This Do

Currently, if async calls done in the GraphQL result in exceptions, the integration will return the exception wrapped in a CompletionException. This PR instruments the DataFetcherExceptionHandlerParameters.getException method to unwrap the exception of any CompletionException before sending the exception to GraphQL's DataFetcherExceptionHandler.

Note that GraphQL's basic implementation of their DataFetcherExceptionHandler already unwraps one layer of CompletionException.

Motivation

Escalation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@pr-commenter
Copy link

pr-commenter bot commented Jan 15, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/graphql_exception_handler
git_commit_date 1769179884 1769425598
git_commit_sha c6c245f 59f02f1
release_version 1.59.0-SNAPSHOT~c6c245fe4a 1.59.0-SNAPSHOT~59f02f1399
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1769427538 1769427538
ci_job_id 1376213963 1376213963
ci_pipeline_id 92774111 92774111
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-692oohxn 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-692oohxn 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 57 metrics, 8 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.089 s) : 0, 1088759
Total [baseline] (10.794 s) : 0, 10794039
Agent [candidate] (1.09 s) : 0, 1090038
Total [candidate] (10.837 s) : 0, 10837303
section appsec
Agent [baseline] (1.278 s) : 0, 1278317
Total [baseline] (11.06 s) : 0, 11059588
Agent [candidate] (1.272 s) : 0, 1271610
Total [candidate] (10.962 s) : 0, 10962021
section iast
Agent [baseline] (1.232 s) : 0, 1232044
Total [baseline] (11.102 s) : 0, 11101600
Agent [candidate] (1.233 s) : 0, 1232870
Total [candidate] (11.234 s) : 0, 11233882
section profiling
Agent [baseline] (1.218 s) : 0, 1218451
Total [baseline] (10.977 s) : 0, 10977429
Agent [candidate] (1.21 s) : 0, 1210198
Total [candidate] (10.892 s) : 0, 10892250
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.089 s -
Agent appsec 1.278 s 189.559 ms (17.4%)
Agent iast 1.232 s 143.285 ms (13.2%)
Agent profiling 1.218 s 129.692 ms (11.9%)
Total tracing 10.794 s -
Total appsec 11.06 s 265.549 ms (2.5%)
Total iast 11.102 s 307.56 ms (2.8%)
Total profiling 10.977 s 183.39 ms (1.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.09 s -
Agent appsec 1.272 s 181.572 ms (16.7%)
Agent iast 1.233 s 142.832 ms (13.1%)
Agent profiling 1.21 s 120.16 ms (11.0%)
Total tracing 10.837 s -
Total appsec 10.962 s 124.718 ms (1.2%)
Total iast 11.234 s 396.578 ms (3.7%)
Total profiling 10.892 s 54.947 ms (0.5%)
gantt
    title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.175 ms) : 0, 1175
crashtracking [candidate] (1.185 ms) : 0, 1185
BytebuddyAgent [baseline] (651.358 ms) : 0, 651358
BytebuddyAgent [candidate] (652.121 ms) : 0, 652121
GlobalTracer [baseline] (286.092 ms) : 0, 286092
GlobalTracer [candidate] (286.551 ms) : 0, 286551
AppSec [baseline] (32.928 ms) : 0, 32928
AppSec [candidate] (32.99 ms) : 0, 32990
Debugger [baseline] (66.808 ms) : 0, 66808
Debugger [candidate] (67.567 ms) : 0, 67567
Remote Config [baseline] (593.713 µs) : 0, 594
Remote Config [candidate] (607.85 µs) : 0, 608
Telemetry [baseline] (9.664 ms) : 0, 9664
Telemetry [candidate] (8.889 ms) : 0, 8889
Flare Poller [baseline] (4.489 ms) : 0, 4489
Flare Poller [candidate] (4.491 ms) : 0, 4491
section appsec
crashtracking [baseline] (1.175 ms) : 0, 1175
crashtracking [candidate] (1.174 ms) : 0, 1174
BytebuddyAgent [baseline] (695.383 ms) : 0, 695383
BytebuddyAgent [candidate] (692.311 ms) : 0, 692311
GlobalTracer [baseline] (265.461 ms) : 0, 265461
GlobalTracer [candidate] (262.515 ms) : 0, 262515
AppSec [baseline] (175.348 ms) : 0, 175348
AppSec [candidate] (174.074 ms) : 0, 174074
Debugger [baseline] (66.506 ms) : 0, 66506
Debugger [candidate] (67.493 ms) : 0, 67493
Remote Config [baseline] (709.157 µs) : 0, 709
Remote Config [candidate] (701.202 µs) : 0, 701
Telemetry [baseline] (9.348 ms) : 0, 9348
Telemetry [candidate] (9.316 ms) : 0, 9316
Flare Poller [baseline] (3.651 ms) : 0, 3651
Flare Poller [candidate] (3.588 ms) : 0, 3588
IAST [baseline] (25.139 ms) : 0, 25139
IAST [candidate] (24.878 ms) : 0, 24878
section iast
crashtracking [baseline] (1.179 ms) : 0, 1179
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (794.856 ms) : 0, 794856
BytebuddyAgent [candidate] (794.32 ms) : 0, 794320
GlobalTracer [baseline] (260.235 ms) : 0, 260235
GlobalTracer [candidate] (261.025 ms) : 0, 261025
AppSec [baseline] (33.709 ms) : 0, 33709
AppSec [candidate] (33.784 ms) : 0, 33784
Debugger [baseline] (66.83 ms) : 0, 66830
Debugger [candidate] (66.814 ms) : 0, 66814
Remote Config [baseline] (539.527 µs) : 0, 540
Remote Config [candidate] (550.975 µs) : 0, 551
Telemetry [baseline] (8.434 ms) : 0, 8434
Telemetry [candidate] (8.767 ms) : 0, 8767
Flare Poller [baseline] (3.471 ms) : 0, 3471
Flare Poller [candidate] (3.595 ms) : 0, 3595
IAST [baseline] (27.292 ms) : 0, 27292
IAST [candidate] (27.364 ms) : 0, 27364
section profiling
crashtracking [baseline] (1.215 ms) : 0, 1215
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (707.468 ms) : 0, 707468
BytebuddyAgent [candidate] (702.88 ms) : 0, 702880
GlobalTracer [baseline] (227.61 ms) : 0, 227610
GlobalTracer [candidate] (225.619 ms) : 0, 225619
AppSec [baseline] (32.943 ms) : 0, 32943
AppSec [candidate] (32.503 ms) : 0, 32503
Debugger [baseline] (68.249 ms) : 0, 68249
Debugger [candidate] (68.078 ms) : 0, 68078
Remote Config [baseline] (621.075 µs) : 0, 621
Remote Config [candidate] (608.007 µs) : 0, 608
Telemetry [baseline] (8.885 ms) : 0, 8885
Telemetry [candidate] (8.828 ms) : 0, 8828
Flare Poller [baseline] (3.654 ms) : 0, 3654
Flare Poller [candidate] (3.617 ms) : 0, 3617
ProfilingAgent [baseline] (97.492 ms) : 0, 97492
ProfilingAgent [candidate] (96.978 ms) : 0, 96978
Profiling [baseline] (98.071 ms) : 0, 98071
Profiling [candidate] (97.558 ms) : 0, 97558
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.089 s) : 0, 1088709
Total [baseline] (8.768 s) : 0, 8767626
Agent [candidate] (1.09 s) : 0, 1089689
Total [candidate] (8.781 s) : 0, 8781196
section iast
Agent [baseline] (1.25 s) : 0, 1249559
Total [baseline] (9.398 s) : 0, 9398171
Agent [candidate] (1.241 s) : 0, 1240906
Total [candidate] (9.45 s) : 0, 9450175
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.089 s -
Agent iast 1.25 s 160.85 ms (14.8%)
Total tracing 8.768 s -
Total iast 9.398 s 630.546 ms (7.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.09 s -
Agent iast 1.241 s 151.217 ms (13.9%)
Total tracing 8.781 s -
Total iast 9.45 s 668.979 ms (7.6%)
gantt
    title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.175 ms) : 0, 1175
crashtracking [candidate] (1.176 ms) : 0, 1176
BytebuddyAgent [baseline] (652.278 ms) : 0, 652278
BytebuddyAgent [candidate] (652.812 ms) : 0, 652812
GlobalTracer [baseline] (286.314 ms) : 0, 286314
GlobalTracer [candidate] (286.755 ms) : 0, 286755
AppSec [baseline] (32.885 ms) : 0, 32885
AppSec [candidate] (32.859 ms) : 0, 32859
Debugger [baseline] (67.25 ms) : 0, 67250
Debugger [candidate] (67.113 ms) : 0, 67113
Remote Config [baseline] (603.259 µs) : 0, 603
Remote Config [candidate] (601.324 µs) : 0, 601
Telemetry [baseline] (8.872 ms) : 0, 8872
Telemetry [candidate] (8.997 ms) : 0, 8997
Flare Poller [baseline] (3.738 ms) : 0, 3738
Flare Poller [candidate] (3.754 ms) : 0, 3754
section iast
crashtracking [baseline] (1.202 ms) : 0, 1202
crashtracking [candidate] (1.184 ms) : 0, 1184
BytebuddyAgent [baseline] (808.476 ms) : 0, 808476
BytebuddyAgent [candidate] (801.911 ms) : 0, 801911
GlobalTracer [baseline] (263.629 ms) : 0, 263629
GlobalTracer [candidate] (261.729 ms) : 0, 261729
AppSec [baseline] (33.457 ms) : 0, 33457
AppSec [candidate] (34.81 ms) : 0, 34810
Debugger [baseline] (66.968 ms) : 0, 66968
Debugger [candidate] (65.601 ms) : 0, 65601
Remote Config [baseline] (545.229 µs) : 0, 545
Remote Config [candidate] (547.062 µs) : 0, 547
Telemetry [baseline] (8.422 ms) : 0, 8422
Telemetry [candidate] (8.647 ms) : 0, 8647
Flare Poller [baseline] (3.47 ms) : 0, 3470
Flare Poller [candidate] (3.556 ms) : 0, 3556
IAST [baseline] (27.579 ms) : 0, 27579
IAST [candidate] (27.374 ms) : 0, 27374
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/graphql_exception_handler
git_commit_date 1769179884 1769425598
git_commit_sha c6c245f 59f02f1
release_version 1.59.0-SNAPSHOT~c6c245fe4a 1.59.0-SNAPSHOT~59f02f1399
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1769428027 1769428027
ci_job_id 1376213966 1376213966
ci_pipeline_id 92774111 92774111
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-b7t9iz6n 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-b7t9iz6n 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 1 performance improvements and 2 performance regressions! Performance is the same for 16 metrics, 17 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:petclinic:profiling:high_load worse
[+378.475µs; +1369.838µs] or [+2.069%; +7.490%]
same
[-90.631µs; +1269.991µs] or [-0.301%; +4.220%]
unstable
[-34.272op/s; +13.647op/s] or [-13.680%; +5.447%]
19.163ms 30.685ms 240.219op/s 18.288ms 30.096ms 250.531op/s
scenario:load:petclinic:tracing:high_load better
[-819.367µs; -454.518µs] or [-4.554%; -2.526%]
unsure
[-1011.933µs; -22.354µs] or [-3.465%; -0.077%]
unstable
[-17.457op/s; +31.707op/s] or [-6.846%; +12.434%]
17.357ms 28.689ms 262.125op/s 17.994ms 29.206ms 255.000op/s
scenario:load:petclinic:no_agent:high_load worse
[+0.522ms; +1.891ms] or [+2.933%; +10.632%]
unstable
[+0.206ms; +3.241ms] or [+0.695%; +10.960%]
unstable
[-41.538op/s; +10.163op/s] or [-16.220%; +3.969%]
18.996ms 31.293ms 240.406op/s 17.789ms 29.570ms 256.094op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a
    dateFormat X
    axisFormat %s
section baseline
no_agent (18.225 ms) : 18040, 18409
.   : milestone, 18225,
appsec (18.558 ms) : 18372, 18743
.   : milestone, 18558,
code_origins (18.618 ms) : 18433, 18802
.   : milestone, 18618,
iast (17.94 ms) : 17760, 18121
.   : milestone, 17940,
profiling (18.632 ms) : 18441, 18823
.   : milestone, 18632,
tracing (18.305 ms) : 18123, 18487
.   : milestone, 18305,
section candidate
no_agent (19.416 ms) : 19216, 19616
.   : milestone, 19416,
appsec (18.799 ms) : 18607, 18991
.   : milestone, 18799,
code_origins (18.515 ms) : 18327, 18703
.   : milestone, 18515,
iast (17.831 ms) : 17652, 18010
.   : milestone, 17831,
profiling (19.436 ms) : 19240, 19632
.   : milestone, 19436,
tracing (17.802 ms) : 17625, 17980
.   : milestone, 17802,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.225 ms [18.04 ms, 18.409 ms] -
appsec 18.558 ms [18.372 ms, 18.743 ms] 332.937 µs (1.8%)
code_origins 18.618 ms [18.433 ms, 18.802 ms] 392.982 µs (2.2%)
iast 17.94 ms [17.76 ms, 18.121 ms] -284.115 µs (-1.6%)
profiling 18.632 ms [18.441 ms, 18.823 ms] 407.379 µs (2.2%)
tracing 18.305 ms [18.123 ms, 18.487 ms] 80.118 µs (0.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 19.416 ms [19.216 ms, 19.616 ms] -
appsec 18.799 ms [18.607 ms, 18.991 ms] -617.073 µs (-3.2%)
code_origins 18.515 ms [18.327 ms, 18.703 ms] -901.118 µs (-4.6%)
iast 17.831 ms [17.652 ms, 18.01 ms] -1.585 ms (-8.2%)
profiling 19.436 ms [19.24 ms, 19.632 ms] 19.881 µs (0.1%)
tracing 17.802 ms [17.625 ms, 17.98 ms] -1.614 ms (-8.3%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.177 ms) : 1165, 1189
.   : milestone, 1177,
iast (3.262 ms) : 3213, 3312
.   : milestone, 3262,
iast_FULL (5.607 ms) : 5552, 5662
.   : milestone, 5607,
iast_GLOBAL (3.653 ms) : 3599, 3706
.   : milestone, 3653,
profiling (2.09 ms) : 2071, 2109
.   : milestone, 2090,
tracing (1.769 ms) : 1755, 1784
.   : milestone, 1769,
section candidate
no_agent (1.202 ms) : 1190, 1214
.   : milestone, 1202,
iast (3.248 ms) : 3202, 3293
.   : milestone, 3248,
iast_FULL (5.76 ms) : 5703, 5818
.   : milestone, 5760,
iast_GLOBAL (3.609 ms) : 3559, 3659
.   : milestone, 3609,
profiling (1.962 ms) : 1945, 1979
.   : milestone, 1962,
tracing (1.805 ms) : 1790, 1821
.   : milestone, 1805,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.177 ms [1.165 ms, 1.189 ms] -
iast 3.262 ms [3.213 ms, 3.312 ms] 2.085 ms (177.1%)
iast_FULL 5.607 ms [5.552 ms, 5.662 ms] 4.43 ms (376.3%)
iast_GLOBAL 3.653 ms [3.599 ms, 3.706 ms] 2.475 ms (210.3%)
profiling 2.09 ms [2.071 ms, 2.109 ms] 912.872 µs (77.5%)
tracing 1.769 ms [1.755 ms, 1.784 ms] 592.338 µs (50.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.202 ms [1.19 ms, 1.214 ms] -
iast 3.248 ms [3.202 ms, 3.293 ms] 2.046 ms (170.2%)
iast_FULL 5.76 ms [5.703 ms, 5.818 ms] 4.559 ms (379.3%)
iast_GLOBAL 3.609 ms [3.559 ms, 3.659 ms] 2.407 ms (200.3%)
profiling 1.962 ms [1.945 ms, 1.979 ms] 760.413 µs (63.3%)
tracing 1.805 ms [1.79 ms, 1.821 ms] 603.478 µs (50.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/graphql_exception_handler
git_commit_date 1769179884 1769425598
git_commit_sha c6c245f 59f02f1
release_version 1.59.0-SNAPSHOT~c6c245fe4a 1.59.0-SNAPSHOT~59f02f1399
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1769427682 1769427682
ci_job_id 1376213970 1376213970
ci_pipeline_id 92774111 92774111
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-r7qnjzxu 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-r7qnjzxu 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.839 s) : 14839000, 14839000
.   : milestone, 14839000,
appsec (14.78 s) : 14780000, 14780000
.   : milestone, 14780000,
iast (18.087 s) : 18087000, 18087000
.   : milestone, 18087000,
iast_GLOBAL (17.768 s) : 17768000, 17768000
.   : milestone, 17768000,
profiling (14.717 s) : 14717000, 14717000
.   : milestone, 14717000,
tracing (14.757 s) : 14757000, 14757000
.   : milestone, 14757000,
section candidate
no_agent (15.495 s) : 15495000, 15495000
.   : milestone, 15495000,
appsec (14.644 s) : 14644000, 14644000
.   : milestone, 14644000,
iast (18.408 s) : 18408000, 18408000
.   : milestone, 18408000,
iast_GLOBAL (17.821 s) : 17821000, 17821000
.   : milestone, 17821000,
profiling (14.823 s) : 14823000, 14823000
.   : milestone, 14823000,
tracing (14.991 s) : 14991000, 14991000
.   : milestone, 14991000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.839 s [14.839 s, 14.839 s] -
appsec 14.78 s [14.78 s, 14.78 s] -59.0 ms (-0.4%)
iast 18.087 s [18.087 s, 18.087 s] 3.248 s (21.9%)
iast_GLOBAL 17.768 s [17.768 s, 17.768 s] 2.929 s (19.7%)
profiling 14.717 s [14.717 s, 14.717 s] -122.0 ms (-0.8%)
tracing 14.757 s [14.757 s, 14.757 s] -82.0 ms (-0.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.495 s [15.495 s, 15.495 s] -
appsec 14.644 s [14.644 s, 14.644 s] -851.0 ms (-5.5%)
iast 18.408 s [18.408 s, 18.408 s] 2.913 s (18.8%)
iast_GLOBAL 17.821 s [17.821 s, 17.821 s] 2.326 s (15.0%)
profiling 14.823 s [14.823 s, 14.823 s] -672.0 ms (-4.3%)
tracing 14.991 s [14.991 s, 14.991 s] -504.0 ms (-3.3%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~59f02f1399, baseline=1.59.0-SNAPSHOT~c6c245fe4a
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.469 ms) : 1457, 1480
.   : milestone, 1469,
appsec (2.465 ms) : 2412, 2517
.   : milestone, 2465,
iast (2.205 ms) : 2140, 2270
.   : milestone, 2205,
iast_GLOBAL (2.252 ms) : 2186, 2317
.   : milestone, 2252,
profiling (2.48 ms) : 2318, 2642
.   : milestone, 2480,
tracing (2.053 ms) : 2002, 2105
.   : milestone, 2053,
section candidate
no_agent (1.472 ms) : 1461, 1484
.   : milestone, 1472,
appsec (3.712 ms) : 3493, 3930
.   : milestone, 3712,
iast (2.201 ms) : 2136, 2265
.   : milestone, 2201,
iast_GLOBAL (2.253 ms) : 2188, 2319
.   : milestone, 2253,
profiling (2.045 ms) : 1993, 2098
.   : milestone, 2045,
tracing (2.046 ms) : 1994, 2098
.   : milestone, 2046,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.469 ms [1.457 ms, 1.48 ms] -
appsec 2.465 ms [2.412 ms, 2.517 ms] 995.81 µs (67.8%)
iast 2.205 ms [2.14 ms, 2.27 ms] 736.17 µs (50.1%)
iast_GLOBAL 2.252 ms [2.186 ms, 2.317 ms] 782.98 µs (53.3%)
profiling 2.48 ms [2.318 ms, 2.642 ms] 1.011 ms (68.8%)
tracing 2.053 ms [2.002 ms, 2.105 ms] 584.424 µs (39.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.472 ms [1.461 ms, 1.484 ms] -
appsec 3.712 ms [3.493 ms, 3.93 ms] 2.24 ms (152.1%)
iast 2.201 ms [2.136 ms, 2.265 ms] 728.243 µs (49.5%)
iast_GLOBAL 2.253 ms [2.188 ms, 2.319 ms] 781.109 µs (53.1%)
profiling 2.045 ms [1.993 ms, 2.098 ms] 573.032 µs (38.9%)
tracing 2.046 ms [1.994 ms, 2.098 ms] 573.618 µs (39.0%)

@mhlidd mhlidd marked this pull request as ready for review January 16, 2026 19:00
@mhlidd mhlidd requested a review from a team as a code owner January 16, 2026 19:00
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

jordan-wong
jordan-wong previously approved these changes Jan 16, 2026
Copy link
Contributor

@jordan-wong jordan-wong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would want to make sure there are no issues with unwrapping in all possible cases. Perhaps keeping the original exception would be helpful for keeping context of where the original exception occurred in the stack trace, because unwrapping will only keep the inner exception's stack trace. Otherwise if this is not a concern, then LGTM

Copy link
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it stands this will result in both DataFetcherExceptionHandlerParametersInstrumentations being applied to GraphQL versions below 20

The new instrumentation in graphql-java-14.0 will apply because the extra checks that the version is < 20 will pass. But the new instrumentation in graphql-java-20.0 will also apply because it has no checks that the version is >= 20.

This isn't covered by the muzzle checks, because the graphql 20 project is missing a check that the advice there doesn't apply for versions before 20:

  fail {
    group = "com.graphql-java"
    module = 'graphql-java'
    versions = '[,20)'
  }

PS. muzzle is currently failing for graphql-java-14.0 because the new instrumentation will apply to versions before 14 as well (there's an assertInverse on the graphql-java-14.0 muzzle directive which means check it doesn't match versions outside the directive)

You could fix this up with a bunch of additional checks, but I'm thinking it might make more sense to move DataFetcherExceptionHandlerParametersInstrumentation to the graphql-java-common project and have it just declared once, since we know it will apply to every version of GraphQL. (Maybe at the same time give it a shorter name that indicates what it does, such as GraphQLUnwrapExceptionInstrumentation)

@mcculls mcculls added type: bug Bug report and fix inst: graphql GraphQL instrumentation labels Jan 19, 2026
@mcculls
Copy link
Contributor

mcculls commented Jan 19, 2026

Related question to the one from @jordan-wong - do we need to unwind all CompletionExceptions or would it be enough to only unwrap once?

Also can we assume that the CompletionException to unwrap will be current one, like SimpleDataFetcherExceptionHandler does?

@mhlidd
Copy link
Contributor Author

mhlidd commented Jan 20, 2026

Thanks for the tips Stuart!

Related question to the one from @jordan-wong - do we need to unwind all CompletionExceptions or would it be enough to only unwrap once?

GraphQL already unwraps one layer of CompletionException, so my thought process was that if the user is still seeing CompletionExceptions in the error stack trace, it would mean that there were nested CompletionExceptions. Hence, why I unwrap all CompletionExceptions.

Also can we assume that the CompletionException to unwrap will be current one, like SimpleDataFetcherExceptionHandler does?

I'm not sure what you mean by current?

@mcculls
Copy link
Contributor

mcculls commented Jan 20, 2026

I'm not sure what you mean by current?

Basically, instead of looping through the entire chain of exceptions collapsing any CompletionExceptions could we just check the current exception, and if it's a CompletionException then use its cause.

i.e. do the same as the existing unwrap code in graphql - in other words, could we just unwrap once rather than keep unwrapping

Copy link
Contributor

@ValentinZakharov ValentinZakharov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m concerned the solution doesn’t address the root cause - our instrumentation still returns a derived CompleteStage instead of original one. This could potentially leads to CompletionException been observed outside graphql handler (at HTTP/web-framework layer), so 422->500 issue may happens depends on where HTTP Status mapping happens

@mcculls mcculls dismissed stale reviews from jordan-wong and themself January 20, 2026 21:11

Dismissing stale review

import java.util.concurrent.CompletionException;

public final class AsyncExceptionUnwrapper {
private static final int MAX_UNWRAP_DEPTH = 32;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can now be removed

Suggested change
private static final int MAX_UNWRAP_DEPTH = 32;

@mcculls
Copy link
Contributor

mcculls commented Jan 20, 2026

FYI, merge in latest master to pick up a couple of build-related fixes

@mhlidd mhlidd merged commit 73e4642 into master Jan 26, 2026
718 of 720 checks passed
@mhlidd mhlidd deleted the mhlidd/graphql_exception_handler branch January 26, 2026 14:28
@github-actions github-actions bot added this to the 1.59.0 milestone Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: graphql GraphQL instrumentation type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants